import { Component, OnInit } from '@angular/core';
import { DashboardService } from 'src/app/shared/services/http/dashboard.service';
import { StatisticDto } from 'src/app/shared/services/http/dto/dashboard.dto';

@Component({
  selector: 'app-dashboard-statistic',
  templateUrl: './dashboard-statistic.component.html',
  styleUrls: ['./dashboard-statistic.component.css'],
})
export class DashboardStatisticComponent implements OnInit {
  statistic: StatisticDto = {
    cumulativeCarwashes: 0,
    cumulativeUsers: 0,
    cumulativeOrders: 0,
    cumulativeTurnover: 0,
    todayNewUsers: 0,
    todayNewOrders: 0,
    todayNewTurnover: 0,
  };

  constructor(private dashboardService: DashboardService) {}

  ngOnInit(): void {
    this.dashboardService.statistic().subscribe((value) => {
      this.statistic = value;
    });
  }
}
